package com.controller.lx;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.entity.Dept;
import com.utils.DeptVo;
import com.service.lx.DeptService;

@Controller
public class DeptController {
	@Autowired
	private DeptService deptService;

	/**
	 * 查询部门
	 * @return
	 */
	@PostMapping("/dept_select_")
	@ResponseBody
	public List<Dept> findAll(){
		return deptService.findAll();
	}
	
	/**
	 * 查询部门显示树形
	 * @return
	 */
	@PostMapping("/depts_select_")
	@ResponseBody
	public List<DeptVo> findAllTree(){
		return deptService.listTbDept();
	}
}
